#!/bin/bash


if [ ${1}x == "x" ]; then
echo "Need a VM name for dropping."
exit 1
fi

virsh dominfo $1 &> /dev/null
if [ $? -ne 0 ]; then
echo "Not exist VM: $1"
exit 1
fi

virsh destroy $1
virsh undefine $1 --remove-all-storage
